﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using MyHotel_DAO;
using MyHotel_DTO;

namespace MyHotel_DAOWS
{
    /// <summary>
    /// Summary description for QuanLyNhanVienDAOWS
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]

    public class QuanLyNhanVienDAOWS : System.Web.Services.WebService
    {
        QuanLyNhanVienDAO _qlnvDAO = new QuanLyNhanVienDAO();

        [WebMethod]
        //kiem tra nhan vien nay co ton tai trong csdl hay khong
        public bool kiemtraMaNhanVien(int maNV)
        {
           return _qlnvDAO.kiemtraMaNhanVien(maNV);
        }

        //ok
        [WebMethod]
        public List<NhanVien> layThongTinNhanVienbyMaChucVu(int maChucVu)
        {
            return _qlnvDAO.layThongTinNhanVienbyMaChucVu(maChucVu);
        }
        //ok
        [WebMethod]
        public List<NhanVien> layThongTinNhanVien()
        {
            return _qlnvDAO.layThongTinNhanVien();
        }

        
        //ok
        [WebMethod]
        public string layTenChucVuByMa(int maChucVu)
        {
            return _qlnvDAO.layTenChucVuByMa(maChucVu);
        }
        //ok
        [WebMethod]
        public bool themNhanVien(NhanVien ttnv)
        {
            return _qlnvDAO.themNhanVien(ttnv);
        }

        [WebMethod]
        public int layMaNVbySoDienThoai(string soDienThoai)
        {
            return _qlnvDAO.layMaNVbySoDienThoai(soDienThoai);
        }

        [WebMethod]
        public int layMaTaiKhoanbyTenDangNhap(string tenDangNhap)
        {
            return _qlnvDAO.layMaTaiKhoanbyTenDangNhap(tenDangNhap);
        }

        [WebMethod]
        public bool suaNhanVien(NhanVien ttnv)
        {
            return _qlnvDAO.suaNhanVien(ttnv);
        }

        [WebMethod]
        public bool xoaNhanVien(NhanVien ttnv)
        {
            return _qlnvDAO.xoaNhanVien(ttnv);
        }

        [WebMethod]
        public bool resetMatKhau(NhanVien ttnv)
        {
            return _qlnvDAO.resetMatKhau(ttnv);
        }

        [WebMethod]
        public bool kiemtraNhanVien_TonTai_DienThoai(string soDT)
        {
            return _qlnvDAO.kiemtraNhanVien_TonTai_DienThoai(soDT);
        }

        [WebMethod]
        public bool kiemtraNhanVien_TonTai_TenDangNhap(string tenDangNhap)
        {
            return _qlnvDAO.kiemtraNhanVien_TonTai_TenDangNhap(tenDangNhap);
        }

        [WebMethod]
        public int layMaChucVuByTenChucVu(string tenChucVu)
        {
            return _qlnvDAO.layMaChucVuByTenChucVu(tenChucVu);
        }

        [WebMethod]
        public int layMaTaiKhoanByTenTaiKhoan(string tenDangNhap)
        {
            return _qlnvDAO.layMaTaiKhoanByTenTaiKhoan(tenDangNhap);
        }
    }
}
